<?php
/**
 * Created by PhpStorm.
 * User: man0sions
 * Date: 16/8/25
 * Time: 下午6:03
 * 该类用于获取配置信息,等初始化操作
 */

namespace src\base;

use src\base\api\Registry;

/**
 * 初始话操作类
 * 实现:
 * 1:时区配置
 * 2:配置文件对象
 *
 * Class ApplicationHelper
 * @package src\base
 */
class ApplicationHelper{
    private $config ;
    private static $instance;

    private function __construct()
    {

    }

    static function getInstance(){
        if(!self::$instance)
            self::$instance = new self();
        return self::$instance;
    }


    function init(){
        date_default_timezone_set("PRC");
        $this->config = new Config('main');
    }

    function getConfig(){
        Registry::set('main_config',$this->config['main']);

        \LuciferP\Orm\base\Registry::set('db_conf',$this->config['main']['db']);
        return $this->config['main'];
    }
}